import { http } from "@/utils/http";
import { globalDataStoreHook } from "@/store/modules/globalData";
import { whReqBaseUrl as VITE_REQUEST_BASE_SAAS_API } from "@/api/common";

// 获取服务网点

export function getHospitals(data) {
  return http.get<any>(`${VITE_REQUEST_BASE_SAAS_API}//hospitals`, {
    params: {
      ...data
    }
  });
}

// 新增服务网点

export function createHospitals(newUserData) {
  return http.postForm<any>(`${VITE_REQUEST_BASE_SAAS_API}/hospitals`, {
    ...newUserData
  });
}

// 编辑服务网点
export function updateHospitals(id, newUserData) {
  return http.postForm<any>(`${VITE_REQUEST_BASE_SAAS_API}/hospitals/${id}`, {
    ...newUserData
  });
}
